<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
    export default {
        mixins: [Vue.prototype.$vFN.Mixins.Base],
        components: {},
        data() {
            return {

                list: [
                    {
                        icon: "el-icon-picture-outline-round",
                        text: "图片",
                        alt:"同步微信资源至平台",
                        type: 1,
                        col:1,
                    },
                    {
                        icon: "el-icon-video-camera",
                        text: "视频",
                        alt:"同步微信资源至平台",
                        type: 2,
                        col:1,
                    },
                    {
                        icon: "el-icon-microphone",
                        text: "音频",
                        alt:"同步微信资源至平台",
                        type: 3,
                        col:1,
                    },
                    {
                        icon: "el-icon-postcard",
                        text: "图文",
                        alt:"同步微信资源至平台",
                        type: 4,
                        col:1,
                    },
                    {
                        icon: "el-icon-files",
                        text: "图片、视频、音频、图文",
                        alt:"同步微信资源至平台",
                        type: 0,
                        col:2,
                    },
                ]
            };
        },
        methods: {

            async select(item_) {
                this.$confirm("确定将微信【"+item_.text+"】素材资源同步至平台么", {
                        confirmButtonText: "确定",
                        cancelButtonText: "取消",
                        dangerouslyUseHTMLString: true,
                    }).then(async () => {
                        this.submit(item_);
                    })
                    .catch(() => {});
            },

            // 提交
            async submit(item_) {
               
                let _data = await this.$vFN.Http.post({
                    url: "mall-site-portal/album-info/materialDownload",
                    data: {
                        type:item_.type
                    },
                },window);
                if (_data._ok) {
                    this.$vFN.Tools.messageSuccess("同步成功");
                }
            },

        },
        mounted() {
        },
        activated() {},
    };
</script>